package GUILayer;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import GUILayer.CustomerGUI;
import GUILayer.StaffGUI;
import GUILayer.ProductGUI;
import GUILayer.SaleGUI;
import GUILayer.OrderGUI;


public class Test extends JFrame implements ActionListener
{
	private JMenuItem item1 = new JMenuItem("Customer");
	private JMenuItem item2 = new JMenuItem("Staff");
	private JMenuItem item3 = new JMenuItem("Sale");
	private JMenuItem item4 = new JMenuItem("Order");
	private JMenuItem item5 = new JMenuItem("Product");
	private JMenuItem item6 = new JMenuItem("Turn off");
	public Test()
	{
		JFrame f = new JFrame("Vestbjerg Byggecenter A/S");
		f.getContentPane().setBackground(Color.GRAY);
		JMenuBar mb = new JMenuBar();
		JMenu menu1 = new JMenu("Person");
		menu1.setFont(new Font("Tahoma", Font.PLAIN, 11));
		JMenuBar mb1 = new JMenuBar();
		JMenu menu2 = new JMenu("Sale/Order");
		menu2.setFont(new Font("Tahoma", Font.PLAIN, 11));
		JMenuBar mb2 = new JMenuBar();
		JMenu menu3 = new JMenu("Stock");
		menu3.setFont(new Font("Tahoma", Font.PLAIN, 11));
		JMenuBar mb3 = new JMenuBar();
		JMenu menu4 = new JMenu("System");
		menu4.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item1.setFont(new Font("Tahoma", Font.PLAIN, 11));
		
		item1.addActionListener(this);
		item2.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item2.addActionListener(this);
		item3.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item3.addActionListener(this);
		item4.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item4.addActionListener(this);
		item5.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item5.addActionListener(this);
		item6.setFont(new Font("Tahoma", Font.PLAIN, 11));
		item6.addActionListener(this);
		
		menu1.add(item1);
		menu1.add(item2);
		menu2.add(item3);
		menu2.add(item4);
		menu3.add(item5);
		menu4.add(item6);
		
		
		mb.add(menu1);
		mb.add(menu2);
		mb.add(menu3);
		mb.add(menu4);
		f.setJMenuBar(mb);
		f.setSize(600,400);
		f.getContentPane().setLayout(null);
		
		JLabel lblVestbjergByggeserviceAs = new JLabel("Vestbjerg Byggecenter A/S");
		lblVestbjergByggeserviceAs.setForeground(Color.WHITE);
		lblVestbjergByggeserviceAs.setFont(new Font("Calibri", Font.PLAIN, 33));
		lblVestbjergByggeserviceAs.setBounds(103, 145, 378, 49);
		f.getContentPane().add(lblVestbjergByggeserviceAs);
		f.setVisible(true);
	}
	public void actionPerformed(ActionEvent e)
	{
		if(e.getSource() == item1)
		{
			startCustomerGUI();
		}
		if(e.getSource() == item2)
		{
			startStaffGUI();
		}
		if(e.getSource() == item3)
		{
			startSaleGUI();
		}
		if(e.getSource() == item4)
		{
			startOrderGUI();
		}
		if(e.getSource() == item5)
		{
			startProductGUI();
		}
		if(e.getSource() == item6)
		{
			System.exit(0);
		}
		
		
	}
	
	public static void main(String args[])
	{
		new Test();
	}
	private void startCustomerGUI()
    {
		CustomerGUI customerGUI = new CustomerGUI();
		customerGUI.setVisible(true);
    }
	private void startStaffGUI()
	{
		StaffGUI staffGUI = new StaffGUI();
		staffGUI.setVisible(true);
	}
	private void startProductGUI()
	{
		ProductGUI productGUI = new ProductGUI();
		productGUI.setVisible(true);
	}
	private void startSaleGUI()
	{
		SaleGUI saleGUI = new SaleGUI();
		saleGUI.setVisible(true);
	}
	private void startOrderGUI()
	{
		OrderGUI orderGUI = new OrderGUI();
		orderGUI.setVisible(true);
	}

	

}
